package com.example.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;


@Mapper
public interface UserMapper extends BaseMapper<User>{

    @Select("select * from user where username=#{username}")
    public User find(String username);


    @Insert("insert into user(username,password,grade,profession,credit) values(#{username},#{password},#{grade},#{profession},#{credit})")
    public int register(User user);

}
